@model LanLordz.Models.ChangePasswordModel
@{
    var controller = this.ViewContext.Controller as LanLordzBaseController;
    ViewBag.Title = controller.CurrentUser == null ? "Forgot Password" : "Change Password";
}
    <h2>@ViewBag.Title</h2>
    @using (Html.BeginForm())
    {
     @Html.AntiForgeryToken()
     @Html.ValidationSummary("There was an error processing your request:", new { @class = "ErrorText" })
     if (Model.User == null)
     {
     <table>
        <tr><td>Username:</td><td>@Html.TextBox("Username")</td></tr>
        <tr><td></td><td><input type="submit" value="Continue" /></td></tr>
     </table>
     }
     else
     {
         if (controller.CurrentUser == null && Model.User.IsEmailConfirmed)
         {
     <p>An email has been sent to the address we have on file.  The message contains a key for changing your password.  You must retrieve that key before you may change your password.</p>
         }
     <table>
      @if (controller.CurrentUser != null)
      {
      <tr><td>Current Password:</td><td>@Html.Password("CurrentPassword")</td></tr>
      <tr><td></td><td><hr /></td></tr>
      }
      else if (Model.User.IsEmailConfirmed)
      {
      <tr><td>Key:</td><td>@Html.TextBox("SecurityKey")</td></tr>
      <tr><td></td><td><hr /></td></tr>
      }
      <tr><td>Question:</td><td>@Model.User.SecurityQuestion</td></tr>
      <tr><td>Answer:</td><td>@Html.TextBox("SecurityAnswer")</td></tr>
      <tr><td></td><td><hr /></td></tr>
      <tr><td>New Password:</td><td>@Html.Password("Password")</td></tr>
      <tr><td>Confirm Password:</td><td>@Html.Password("ConfirmPassword")</td></tr>
      @if (Model != null && Model.RequireCaptcha)
      {
      <tr>
       <td>Human?:</td>
       <td>@Html.Captcha(controller.Config.RecaptchaPublicKey, controller.Config.RecaptchaPrivateKey)</td>
      </tr>
      }
      <tr><td></td><td><input type="submit" value="Continue" /></td></tr>
     </table>
     }
    }
